<template>
	<view class="content">
		<!-- 如果您想在index页面切换显示不同组件 -->
		<component :is="currentComponent"></component>
	</view>
</template>

<script>
	// 导入需要的组件
	import Home from '../home/home.vue'
	import Ai from '../ai/ai.vue'
	import Msg from '../msg/msg.vue'
	import My from '../my/my.vue'
	
	export default {
		components: {
			Home,
			Ai,
			Msg,
			My
		},
		data() {
			return {
				currentComponent: 'Home'
			}
		},
		onLoad() {
			// 默认显示Home组件
			this.currentComponent = 'Home'
		},
		methods: {
			switchComponent(componentName) {
				this.currentComponent = componentName
			}
		}
	}
</script>

<style>
	.content {
		width: 100%;
		height: 100%;
	}
</style>
